#include<iostream>
#include<vector>
using namespace std;


int main()
{
  vector<int> v = {7,2,7,8,9,2,2,5,6,8,8,5,8,0,1,9};
  int maxval = v[0],count = 1;
  for(int i = 1;i<v.size();i++)
  {
    if(v[i] == maxval)
    {
      count++;
    }
    else if(v[i] > maxval)
    {
      maxval = v[i];
      count = 1;
    }
  }
  std::cout <<maxval << " " << count << std::endl;
  return 0;
}
